package com.hbplat.test.jdbc.consumer.controller.base;

import com.github.pagehelper.PageInfo;
import com.hbplat.shardingsphere.common.ServerResponse;
import com.hbplat.test.jdbc.provider.entity.base.dto.BaseUserDTO;
import com.hbplat.test.jdbc.provider.service.base.IBaseUserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 　　* @description: TODO
 * 　　* @param
 * 　　* @return
 * 　　* @throws
 * 　　* @author 陈宇
 * 　　* @date $ $
 *
 */

@RefreshScope
@RestController
public class BaseUserController {


    @Reference(version = "1.0.0",group = "bus",check = false)
    private IBaseUserService iBaseUserService;

    /**
     * 批量新增用户
     * @param baseUserDTO
     * @param request
     * @return
     */
    @PostMapping("/bus/addBaseUser")
    public ServerResponse<String> addBaseUser(BaseUserDTO baseUserDTO, HttpServletRequest request) {
        return iBaseUserService.addBaseUser(baseUserDTO);
    }


    /**
     * 批量查询用户
     * @param baseUserDTO
     * @param request
     * @return
     */
    @GetMapping("/bus/selectListBaseUser")
    public ServerResponse<PageInfo> selectListBaseUser(BaseUserDTO baseUserDTO, HttpServletRequest request) {
        return iBaseUserService.selectListBaseUser(baseUserDTO);
    }

}
